/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.thompv.btvn2;
import java.util.Scanner;
/**
 *
 * @author SONY
 */
public class Bai6 {
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        String s;
        System.out.println("Nhap xau: ");
        s=sc.nextLine();
        s=s.toLowerCase();
        s=s.replaceAll("  "," ");
        String s1[]=s.split(" ");
        System.out.println("Chuoi da chuan hoa:");
        for(int i=0;i<s1.length-1;i++)
         if(!s1[i].equals(""))   
         {
             System.out.print(String.valueOf(s1[i].charAt(0)).toUpperCase()+s1[i].substring(1)+" ");
         }
         if(!s1[s1.length-1].equals(""))
             System.out.println(String.valueOf(s1[s1.length-1].charAt(0)).toUpperCase()+s1[s1.length-1].substring(1));
    }
}
